package com.onpositive.mediawiki.serializing;

import java.io.DataOutputStream;
import java.io.IOException;

import com.onpositive.data.serializer.writers.StringWriter;
import com.onpositive.units.ParsedValue;

public class StringValueWriter extends AbstractMediaWikiWriter<ParsedValue> {
	
	StringWriter sw = new StringWriter() ;
	
	public StringValueWriter()
	{
		super(ParsedValue.class);
	}

	@Override
	public void append(ParsedValue obj)
	{
		String str = obj != null ? (String)obj.getValueAsString() : null ;
		sw.append(str);		
	}


	@Override
	public void serialize(DataOutputStream stream) throws IOException
	{
		sw.serialize( stream );
	}

}
